Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move amplify config into common module #763

Merged
merged 4 commits into from
May 7, 2018

Conversation

powerful23
Copy link
Contributor

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-io
Copy link

codecov-io commented Apr 30, 2018

Codecov Report

Merging #763 into master will increase coverage by 0.26%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #763      +/-   ##
==========================================
+ Coverage   87.46%   87.72%   +0.26%     
==========================================
  Files          74       75       +1     
  Lines        3558     3593      +35     
  Branches      680      683       +3     
==========================================
+ Hits         3112     3152      +40     
+ Misses        424      419       -5     
  Partials       22       22
Impacted Files Coverage Δ
packages/aws-amplify/src/Common/index.ts 82.6% <100%> (+0.79%) ⬆️
packages/aws-amplify/src/PubSub/PubSub.ts 91.17% <100%> (ø) ⬆️
packages/aws-amplify/src/PubSub/index.ts 100% <100%> (ø) ⬆️
packages/aws-amplify/src/Analytics/Analytics.ts 81.37% <100%> (-2.95%) ⬇️
packages/aws-amplify/src/Common/Amplify.ts 100% <100%> (ø)
packages/aws-amplify/src/Auth/index.ts 100% <100%> (ø) ⬆️
packages/aws-amplify/src/Common/I18n/index.ts 71.42% <100%> (+27.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1bb96a0...23a5374. Read the comment docs.

Copy link
Contributor

@elorzafe elorzafe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache is not registered is that ok?

private static _components = [];
private static _config = {};

static Auth = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are any of this being used? I think component should have a category so it can be attached.

Copy link
Contributor Author

@powerful23 powerful23 May 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are just for backward compatibility since they will be assigned in aws-amplify/index.ts and developers may call

import Amplify from 'aws-amplify';

Amplify.Auth.signIn()

instead of

import { Auth } from 'aws-amplify';

Auth.signIn()

Will add some comments on that.


static addPluggable(pluggable) {
if (pluggable && pluggable['getCategory'] && typeof pluggable['getCategory'] === 'function') {
this._components.map(comp => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is checking the category for the component to be the same for the plugin?

Copy link
Contributor Author

@powerful23 powerful23 May 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be checked in each category's addPluggable() method.

@powerful23
Copy link
Contributor Author

@elorzafe Cache is not registered because for that category we didn't provide such a way to configure it. You need to configure that by calling Cache.configure() manually.

Copy link
Contributor

@elorzafe elorzafe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Nice!

@github-actions
Copy link

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants